﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MShop.Core.Domain.ShopUsersAddress>>" %>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
    <link type="text/css" rel="stylesheet" href="/css/userCenter.css" />
</asp:Content>
<asp:Content ID="changePasswordContent" ContentPlaceHolderID="MainContent" runat="server">
    <% using (Html.BeginForm())
       { %>
    <div id="content" class="ovfl">
        <div id="left" class="side fl">
            <%=Html.Action("menu")%>
        </div>
        <div id="right" class="main fr">
            <div class="main_ct personal">
                   <div class="userMain">
                <ul>
                    <li>
                        <h2 class="title">
                            我的收货地址
                        </h2>
                        <ul>
                            <li>
                                <table>                                    
                                    <th>
                                        地址
                                    </th>
                                    <th>
                                        邮政编码
                                    </th>
                                    <th>
                                        收货人
                                    </th>
                                    <th>
                                        电话
                                    </th>                                   
                                     <th>
                                        默认
                                    </th>  
                                    <% foreach (var item in Model)
                                       { %>
                                    <tr>                                      
                                        <td align="left">
                                         
                                           <%=item.AreaGroup.CurrentAreaName %><br />
                                            &nbsp; &nbsp;<%=item.Location %>
                                            <%=Html.ActionImageLink("/images/edit.png", "CreateAddress", new { id = item.Id }, new {title="修改" })%>
                                            <%=Html.ActionImageLink("/images/ico_del.gif", "DeleteAddress", new { id = item.Id }, new {title="删除",@onclick="return confirm('确认删除该地址?');" })%>
                                        </td>
                                        <td>
                                            <%=item.Postcode %>
                                        </td>
                                        <td>
                                            <%=item.ReceiverName %>
                                        </td>
                                        <td>
                                            <%=item.Mobile %><br />
                                            <%=item.Tel %>
                                        </td>                                       
                                       <td>  <%=item.IsDefault?"<img alt='默认地址' src='/images/default.png' />":"" %></td>
                                    </tr>
                                    <%} %>                                   
                                </table>
                            </li>
                        </ul>
                        <% if (Model.Count() < 5)
                           { %>
                        <input type="button" onclick="location.href='/usercenter/createaddress';" value="创建地址"
                            class="btn_login" />
                        <%} %>
                    </li>
                </ul>
            </div>
            </div>
        </div>
    </div>
    <% } %>
</asp:Content>
